<?php
require_once("../db/db_connector.php");
require_once("../db/db_paradise.php");

// Database Access Begins ---------------------------------------- //
$con = get_db_con();
$paradise_list = get_paradise_list($con);
close_db_con();
// Database Access Ends ------------------------------------------ //

?>

<?php
include_once("../include/admin_header.php");
?>

<h2>Paradise</h2>
<a href="paradise_edit.php">Create Paradise</a>
<table>
	<tr>
		<th>id</th>
		<th>name</th>
		<th>rating</th>
		<th>type</th>
		<th>climate</th>
		<th>climate_high</th>
		<th>climate_low</th>
		<th>continent</th>
		<th>location_long</th>
		<th>location_lat</th>
		<th>language</th>
		<th>religion</th>
		<th>population</th>
		<th>gdp</th>
	</tr>
<?php foreach ($paradise_list as $paradise): ?>
	<tr>
		<td><?=$paradise["id"]?></td>
		<td><?=$paradise["name"]?></td>
		<td><?=$paradise["rating"]?></td>
		<td><?=$paradise["type"]?></td>
		<td><?=$paradise["climate"]?></td>
		<td><?=$paradise["climate_high"]?></td>
		<td><?=$paradise["climate_low"]?></td>
		<td><?=$paradise["continent"]?></td>
		<td><?=$paradise["location_long"]?></td>
		<td><?=$paradise["location_lat"]?></td>
		<td><?=$paradise["language"]?></td>
		<td><?=$paradise["religion"]?></td>
		<td><?=$paradise["population"]?></td>
		<td><?=$paradise["gdp"]?></td>
	</tr>
<?php endforeach ?>
</table>

<?php
include_once("../include/admin_footer.php");
?>
